package com.xqboss.apps.enums.nft;

import com.xqboss.common.enums.BaseEnum;

/**
 * @author Trent
 * @date 2023/8/17
 */
public enum NftTypeEnum implements BaseEnum<Integer> {
    NORMAL(1, "普通藏品"),
    EQUIPMENT(2, "装备藏品"),
    BOX(3, "箱子"),

    ;

    private final String msg;
    private final Integer value;

    NftTypeEnum(Integer value, String desc){
        this.value = value;
        this.msg = desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    // 通过code获取枚举
    public static NftTypeEnum getByCode(Integer code) {
        for (NftTypeEnum nftTypeEnum : NftTypeEnum.values()) {
            if (nftTypeEnum.getValue().equals(code)) {
                return nftTypeEnum;
            }
        }
        return null;
    }
}
